package com.sweet.controller;

import com.sweet.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

@RestController
public class OrderController {
    private static final String REMOTE_SERVICE = "http://sweet-provider-pay-cl8006";

    @Autowired
    private RestTemplate restTemplate;

    @GetMapping("/consumer/cl")
    public Result getRemote() {
        return restTemplate.getForObject(REMOTE_SERVICE+"/cl", Result.class);
    }
}
